package com.ruoyi.dora.portal.controller;


import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.dora.portal.entity.SysDept;
import com.ruoyi.dora.portal.service.ISysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 部门表 前端控制器
 * </p>
 *
 * @author Rubble
 * @since 2021-07-20
 */
@RestController
@RequestMapping("/sys/sys-dept")
public class SysDeptController {

    @Autowired
    private ISysDeptService service;


    @GetMapping("add")
    public Object add(SysDept entity){
        boolean saved = service.save(entity);
        return entity;
    }

    @GetMapping("list")
    public List<SysDept> list(SysDept entity){
        return service.list(new QueryWrapper<>(entity));
    }
}

